<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich" >

<ui:composition template="../commun_page/template.xhtml">

	<ui:define name="title">
			<title>Panier</title>
	</ui:define>

	<ui:define name="body">
	
		
			<h1>Panier</h1>
		  	<rich:dataTable 
		  		id="listePanier"
            	onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
                onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
                cellpadding="0" 
                cellspacing="0" 
                width="700" 
                border="0" 
                var="panier" 
                value="#{panierManager.paniers}"
           	>
            	 <f:facet name="header">
	                 <rich:columnGroup>
	                     <rich:column>
	                         <h:outputText value="Destination" />
	                     </rich:column>
	                     <rich:column>
	                         <h:outputText value="Date" />
	                     </rich:column>
	                     <rich:column>
	                         <h:outputText value="Durée" />
	                     </rich:column>
	                     <rich:column>
	                         <h:outputText value="Prix" />
	                     </rich:column>
	                     <rich:column>
	                         <h:outputText value="Options" />
	                     </rich:column>
	                 </rich:columnGroup>
       			</f:facet>
	                 
                <rich:columnGroup>
                     <rich:column>
                         <h:outputText value="#{panier.refVoyage.destination}" />
                     </rich:column>
                     <rich:column>
                         <h:outputText value="#{panier.refVoyage.date}" />
                     </rich:column>
                     <rich:column>
                         <h:outputText value="#{panier.refVoyage.duree} j" />
                     </rich:column>
                     <rich:column>
                         <h:outputText value="#{panier.refVoyage.prix} " />
                     </rich:column>
                     <rich:column>
						<h:form><img src="../commun_img/trash.png" title="Supprimer du panier" alt="Supprimer du panier" />
							<a4j:commandButton 
								value="Supprimer du panier" 
								action="#{panierManager.supprimer}" reRender="listePanier"   
							>
								<f:setPropertyActionListener 
									value="#{panier.id}"
									target="#{panierManager.idPanier}" 
								/>
							</a4j:commandButton>
						</h:form>
                     </rich:column>
                </rich:columnGroup>
            </rich:dataTable> 
			
	</ui:define>

</ui:composition>

</html>
